home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.6 KB | 176 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWCursor.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #if !defined(FWCURSOR_H) && !defined(__ODFRC__)
- #define FWCURSOR_H
-
- #ifndef FWAUTODE_H
- #include "FWAutoDe.h"
- #endif
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #if defined FW_BUILD_MAC && !defined __QUICKDRAW__
- #include <QuickDraw.h>
- #endif
-
- #if defined FW_BUILD_MAC && !defined __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
- #if defined FW_BUILD_WIN && !defined __INC_WINDOWS
- #include <windows.h>
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Class Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CResourceFile;
- class FW_CLASS_ATTR FW_CCursor;
-
- //========================================================================================
- // Type definitions
- //========================================================================================
- #ifdef FW_BUILD_WIN
- typedef HCURSOR FW_PlatformCursorHandle;
- typedef LPCSTR FW_SystemCursorID;
- #endif
-
- #ifdef FW_BUILD_MAC
- typedef CursHandle FW_PlatformCursorHandle;
- typedef FW_ResourceId FW_SystemCursorID;
- #endif
-
- //========================================================================================
- // Globals
- //========================================================================================
-
- extern FW_CCursor FW_gArrowCursor;
- extern FW_CCursor FW_gIBeamCursor;
- extern FW_CCursor FW_gCrossHairCursor;
- extern FW_CCursor FW_gWaitCursor;
- extern FW_CCursor FW_gOpenHandCursor;
- extern FW_CCursor FW_gClosedHandCursor;
- extern FW_CCursor FW_gSizeWECursor;
- extern FW_CCursor FW_gSizeNSCursor;
- extern FW_CCursor FW_gSizeNWSECursor;
- extern FW_CCursor FW_gSizeNESWCursor;
-
- //========================================================================================
- // FW_CCursor
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CCursor FW_AUTO_DESTRUCT_OBJECT
- {
-
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- FW_CCursor();
- // Create an arrow cursor
-
- #ifdef FW_BUILD_WIN
- FW_CCursor(FW_SystemCursorID systemCursorId);
- // loads a standart cursor from the system file (differed)
- #endif
-
- FW_CCursor(FW_ResourceId resourceId, FW_Boolean fromSystem = FALSE);
- // loads a standart cursor from the system or this library (differed)
-
- FW_CCursor(FW_CResourceFile& resourceFile, FW_ResourceId resourceId);
- // Load a cursor from a file (immediate)
-
- virtual~ FW_CCursor();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- static void Show();
- static void Hide();
- void Select() const;
-
- FW_PlatformCursorHandle GetHandle() const;
-
- protected:
- void PrivLoadSystemCursor(FW_SystemCursorID systemCursorId);
- void PrivLoadCursor(FW_CResourceFile& resourceFile,
- FW_ResourceId resId);
- void PrivDeferredLoad();
-
- private:
- FW_CCursor(const FW_CCursor& other);
- FW_CCursor& operator=(const FW_CCursor& other);
- // Copy constructor and assignment operator not valid for this class.
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- private:
- FW_PlatformCursorHandle fCursorHandle;
-
- FW_Boolean fDeferred; // loaded only at Select
- FW_Boolean fFromSystem;
-
- #ifdef FW_BUILD_WIN
- FW_ResourceId fCursorID;
- FW_SystemCursorID fSystemCursorID;
- #endif
-
- #ifdef FW_BUILD_MAC
- FW_Boolean fMacIsColor;
- FW_ResourceId fCursorID;
- #endif
- };
-
- //----------------------------------------------------------------------------------------
- // FW_CCursor::Show
- //----------------------------------------------------------------------------------------
- inline void FW_CCursor::Show()
- {
- #ifdef FW_BUILD_MAC
- ::ShowCursor();
- #endif
-
- #ifdef FW_BUILD_WIN
- ::ShowCursor(TRUE);
- #endif
-
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CCursor::Hide
- //----------------------------------------------------------------------------------------
- inline void FW_CCursor::Hide()
- {
- #ifdef FW_BUILD_MAC
- ::HideCursor();
- #endif
-
- #ifdef FW_BUILD_WIN
- ::ShowCursor(FALSE);
- #endif
- }
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-
-
-